package views;

import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.part.ViewPart;

public class WorkArea extends ViewPart {

	public static final String ID = "galileo.workarea";
	
	public WorkArea() {
		// TODO Auto-generated constructor stub
	}

	@Override
	public void createPartControl(Composite parent) {
		parent.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_YELLOW));
		
		Label lblInfoText = new Label(parent, SWT.NULL);	
		lblInfoText.setText("Work Area");
		lblInfoText.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
	   
		Label lblTMP = new Label(parent, SWT.NULL);
		lblTMP.setText("\n\n\n\n\n\n\n\n\n");
		
		Composite rdbGrpCont = new Composite(parent, SWT.NONE);
		 GridLayout grid = new GridLayout();
		 grid.numColumns = 2;
		 grid.makeColumnsEqualWidth = true;
		 rdbGrpCont.setLayout(grid);
		 rdbGrpCont.setBackground(Display.getCurrent().getSystemColor(
					SWT.COLOR_YELLOW));
		 
		 Label lblTMP5 = new Label(rdbGrpCont, SWT.NULL);
		lblTMP5.setText("\t");
		lblTMP5.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_YELLOW));
			
		Label lblWRD = new Label(rdbGrpCont, SWT.NULL);
		lblWRD.setText("Word to translate: " /*+ word */);
		lblWRD.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_CYAN));
		 
		 Label lblTMP2 = new Label(rdbGrpCont, SWT.NULL);
		lblTMP2.setText("\t");
		lblTMP2.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_YELLOW));
		
		Text txtType = new Text(rdbGrpCont, SWT.BORDER);
		
		Label lblTMP3 = new Label(rdbGrpCont, SWT.NULL);
		lblTMP3.setText("\t");
		lblTMP3.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_YELLOW));
		
		Label lblPRMT = new Label(rdbGrpCont, SWT.NULL);
		lblPRMT.setText("Prompt: " /*+ prompt */);
		lblPRMT.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_YELLOW));
		
		Label lblTMP4 = new Label(rdbGrpCont, SWT.NULL);
		lblTMP4.setText("\t");
		lblTMP4.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_YELLOW));
		
		Button btnNEXT = new Button(rdbGrpCont, SWT.NONE);
		btnNEXT.setText("  NEXT  ");
        
		btnNEXT.addSelectionListener(new SelectionAdapter() {
        	public void widgetSelected(SelectionEvent e) {
        		// Handle the selection event
        		System.out.println("NEXT!");
        	}
        });
			
		//property 
	     GridLayoutFactory.fillDefaults().numColumns(1).spacing(5, 3).margins(5, 5).applyTo(parent); 
	}

	@Override
	public void setFocus() {
		// TODO Auto-generated method stub
	}

}
